c = "123"
list_c = list(c)
print(list_c)
sum = 0
for i in str(c):
    sum += int(i)
print(sum)

n = "123" #将数字作为字符串输入
list = list(n) #将字符串转换为列表
print(list)
s = 0
for i in range(len(list)):
    s+= int(list[i]) #将字符转换为整数型,并累加列表中的每个数字
print(s)
